package Logic;


import java.io.Serializable;
/**
 * this class runing the main tra
 * @author Ron Shenkerman
 * @author Gabi Revah
 * @author Aviad Almog
 * @author Ivan Onyshchenko
 */
public class Users implements Serializable
{
	
	private String userName;
	private String password;
	private String UserLevel;
	private Boolean connected;
	
	
	/**
	 * constructor of the class
	 * @param userName : Name of the user
	 * @param password : password of the user
	 * @param userLevel : String field 0 if Director , 1 if Librarian ,2 if Subscriber 
	 * @param connected : boolean field 1 if connected 0 if not 
	 */
	public Users(String userName, String password, String userLevel, Boolean connected) 
	{
		System.out.println("user constructor");
		this.userName = userName;
		this.password = password;
		this.UserLevel = userLevel;
		this.connected = connected;
	}
	/** 
	 * Override toString method
	 * return string with users data
	 */
	public String toString()
	{
		return String.format("userName: %s, password: %s, UserLevel: %s, connected: %d\n",userName,password,UserLevel,connected);
	}
	
	
	/**
	 * @return user name
	 */
	public String getUserName() {
		return userName;
	}
	
	/**
	 * @param userName set userName
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	/**
	 * @return user password
	 */
	public String getPassword() {
		return password;
	}
	
	/**
	 * @param password set user password
	 */
	public void setPassword(String password) {
		this.password = password;
	}
	
	
	/**
	 * @return UserLevel
	 */
	public String getUserLevel() {
		return UserLevel;
	}
	
	
	/**
	 * @param UserLevel set UserLevel 0-3
	 */
	public void setUserLevel(String UserLevel) {
		this.UserLevel = UserLevel;
	}
	
	/**
	 * @return Connected 
	 */
	public Boolean getConnected() {
		return connected;
	}
	
	/**
	 * @param connected set connected 0 or 1
	 */
	public void setConnected(Boolean connected) {
		this.connected = connected;
	}
		

	
}
